home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / mac / macdesign.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-07  |  33.8 KB  |  1,105 lines  |  [TEXT/R*ch]

  1. /* Game designer handling for the Mac interface to Xconq.
  2.    Copyright (C) 1992, 1993, 1994, 1995, 1996 Stanley T. Shebs.
  3.  
  4. Xconq is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.  See the file COPYING. */
  8.  
  9. #include "conq.h"
  10. #define make_raw_wind(d,f) (((f) << 3) | (d))
  11. #include "macconq.h"
  12.  
  13. #ifdef DESIGNERS
  14.  
  15. #define numtooltypes 12
  16.  
  17. extern MenuHandle featuremenu;
  18.  
  19. WindowPtr designwin = nil;
  20.  
  21. ControlHandle ttypepopup = nil;
  22. ControlHandle utypepopup = nil;
  23. ControlHandle mtypepopup = nil;
  24. ControlHandle sidepopup = nil;
  25. ControlHandle feature_add_button = nil;
  26. ControlHandle feature_remove_button = nil;
  27. ControlHandle feature_edit_button = nil;
  28. ControlHandle featurepopup = nil;
  29.  
  30. CursHandle paintcursors[numtooltypes];
  31. CursHandle bordpaintor;
  32. CursHandle connpaintor;
  33. CursHandle coatpaintor;
  34.  
  35. /* This is the width and height of each design tool's entry. */
  36.  
  37. int dtoolw = 120;
  38. int dtoolh = 36;
  39.  
  40. /* The type of designer tool currently in use. */
  41.  
  42. enum tooltype tooltype = notool;
  43.  
  44. /* All the state of the designer palette. */
  45.  
  46. short curbrushradius = 0;
  47. short curttype = 0;
  48. short curbgttype = 0;
  49. short curdepth = 1;
  50. short curutype = 0;
  51. short cursidenumber = 0;
  52. short curmtype = 0;
  53. short curmamount = 0;
  54. short curfid = 0;
  55. Feature *curfeature = NULL;
  56. short curelevation = 0;
  57. short curtemperature = 0;
  58. short curcloudtype = 0;
  59. short curcloudbottom = 0;
  60. short curcloudheight = 0;
  61. short curwinddir = 0;
  62. short curwindforce = 0;
  63. short curtview;
  64. short curuview;
  65.  
  66. /* These are globals used in drag painting. */
  67.  
  68. short painttype;
  69. short paintpeop;
  70. short paintfid;
  71. short painttview;
  72. short paintuview;
  73.  
  74. short enabledtooltype[20];
  75.  
  76. void
  77. enable_designing(int forsure)
  78. {
  79.     extern int compromised;
  80.  
  81.     if (dside == NULL || dside->designer)
  82.       return;
  83.     if (!forsure && !compromised) {
  84.         switch (CautionAlert(aConfirmDesign, nil)) {
  85.             case aiConfirmDesignOK:
  86.                 break;
  87.             case aiConfirmDesignCancel:
  88.                 return;
  89.         }
  90.     }
  91.     /* Actually change designer status, this will call back to alter all displays. */
  92.     become_designer(dside);
  93.     /* Create and add the designer's palette. */
  94.     if (designwin == nil) {
  95.         create_design_window();
  96.     }
  97.     if (designwin != nil) {
  98.         position_design_window();
  99.         ShowWindow(designwin);
  100. /*        SelectWindow(designwin); */
  101.     }
  102.     /* Recache visibility flags. */
  103.     calc_vision(dside);
  104. }
  105.  
  106. void
  107. disable_designing()
  108. {
  109.     if (dside == NULL || !dside->designer)
  110.       return;
  111.     /* Hide (but don't destroy) the designer's palette. */
  112.     if (designwin != nil) {
  113.         HideWindow(designwin);
  114.     }
  115.     /* Actually change designer status, this will call back to alter all displays. */
  116.     become_nondesigner(dside);
  117.     /* Recache visibility flags. */
  118.     calc_vision(dside);
  119. }
  120.  
  121. /* Each type of design tool has a distinct cursor. */
  122.  
  123. void
  124. init_design_cursors()
  125. {
  126.     paintcursors[terraintool] = GetCursor(cCell);
  127.     bordpaintor = GetCursor(cBord);
  128.     connpaintor = GetCursor(cConn);
  129.     coatpaintor = GetCursor(cCoat);
  130.     paintcursors[unittool] = GetCursor(cUnit);
  131.     paintcursors[peopletool] = GetCursor(cPeople);
  132.     paintcursors[materialtool] = GetCursor(cMaterial);
  133.     paintcursors[featuretool] = GetCursor(cFeature);
  134.     paintcursors[elevationtool] = GetCursor(cElevation);
  135.     paintcursors[temperaturetool] = GetCursor(cTemperature);
  136.     paintcursors[cloudstool] = GetCursor(cClouds);
  137.     paintcursors[windstool] = GetCursor(cWinds);
  138.     /* (should have a view-painting cursor) */
  139. }
  140.  
  141. /* Adjust the cursor to reflect the current designer tool. */
  142.  
  143. CursPtr
  144. adjust_designer_cursor(Point mouse, RgnHandle region)
  145. {
  146.     if (tooltype == terraintool && !t_is_cell(curttype)) {
  147.         switch (t_subtype(curttype)) {
  148.             case bordersubtype:
  149.                 return *bordpaintor;
  150.             case connectionsubtype:
  151.                 return *connpaintor;
  152.             case coatingsubtype:
  153.                 return *coatpaintor;
  154.             default:
  155.                 terrain_subtype_warning("cursor adjust", curttype);
  156.                 return &QD(arrow);
  157.         }
  158.     }
  159.     return *(paintcursors[tooltype]);
  160. }
  161.  
  162. /* Create the designer tool window. */
  163.  
  164. void
  165. create_design_window()
  166. {
  167.     if (hasColorQD) {
  168.         designwin = GetNewCWindow(wDesign, NULL, (WindowPtr) -1L);
  169.     } else {
  170.         designwin = GetNewWindow(wDesign, NULL, (WindowPtr) -1L);
  171.     }
  172.     add_window_menu_item("Design", designwin);  /* until this becomes a windoid */
  173.     /* Make the current side be the one with the display. */
  174.     cursidenumber = side_number(dside);
  175.     build_terrain_type_menu();
  176.     build_unit_type_menu();
  177.     build_side_menu();
  178.     build_material_type_menu();
  179.     build_feature_menu();
  180.     ttypepopup = GetNewControl(mTerrainTypes, designwin);
  181.     utypepopup = GetNewControl(mUnitTypes, designwin);
  182.     sidepopup = GetNewControl(mSides, designwin);
  183.     mtypepopup = GetNewControl(mMaterialTypes, designwin);
  184.     featurepopup = GetNewControl(mFeatures, designwin);
  185.     feature_add_button = GetNewControl(cFeatureAddButton, designwin);
  186.     feature_remove_button = GetNewControl(cFeatureRemoveButton, designwin);
  187.     feature_edit_button = GetNewControl(cFeatureEditButton, designwin);
  188.     SizeWindow(designwin, 2 * dtoolw - 1, (numtooltypes / 2) * dtoolh - 1, 1);
  189.     position_design_window();
  190.     init_design_cursors();
  191.     enabledtooltype[notool] = TRUE;
  192.     enabledtooltype[terraintool] = TRUE;
  193.     enabledtooltype[unittool] = TRUE;
  194.     enabledtooltype[peopletool] = TRUE;
  195.     enabledtooltype[featuretool] = TRUE;
  196.     enabledtooltype[brushsizetool] = TRUE;
  197.     enabledtooltype[materialtool] = any_materials_in_terrain;
  198.     enabledtooltype[elevationtool] = !world_is_flat();
  199.     enabledtooltype[temperaturetool] = any_temp_variation;
  200.     enabledtooltype[cloudstool] = any_clouds;
  201.     enabledtooltype[windstool] = any_wind_variation;
  202.     enabledtooltype[viewtool] = !all_see_all;
  203.     ShowWindow(designwin);
  204. }
  205.  
  206. /* Try to put the palette alongside the frontmost window. */
  207.  
  208. void
  209. position_design_window()
  210. {
  211.     Point pt;
  212.     WindowPtr win;
  213.     GrafPtr oldport;
  214.  
  215.     /* (should fix all this) */
  216.     if ((win = FrontWindow()) != nil) {
  217.         GetPort(&oldport);
  218.         SetPort(win);
  219.         SetPt(&pt, win->portRect.right + 3, win->portRect.top);
  220.         LocalToGlobal(&pt);
  221.         SetPort(oldport);
  222.     } else {
  223.         SetPt(&pt, 500, 50);
  224.     }
  225.     /* (should make sure is not off the edge of the screen) */
  226.     if (pt.h + 2 * dtoolw > 640 /* is off screen entirely */) {
  227.         SetPt(&pt, 640 - 2 * dtoolw - 2, 50);
  228.     }
  229.     MoveWindow(designwin, pt.h, pt.v, TRUE);
  230. }
  231.  
  232. void
  233. draw_design_window()
  234. {
  235.     int i;
  236.     GrafPtr oldport;
  237.  
  238.     if (!active_display(dside) || designwin == nil) return;
  239.     GetPort(&oldport);
  240.     SetPort(designwin);
  241.     /* Draw each tool's palette item. */
  242.     for (i = 0; i < numtooltypes; ++i) {
  243.         draw_design_window_tool(i);
  244.     }
  245.     DrawControls(designwin);
  246.     SetPort(oldport);
  247. }
  248.  
  249. void
  250. draw_design_window_tool(enum tooltype tool)
  251. {
  252.     int enabled = TRUE, paintable = TRUE;
  253.     char *toolname = NULL, *auxtoolname = NULL;
  254.     Rect tmprect, imagerect;
  255.     char imbuf[BUFSIZE];
  256.     Str255 tmpstr;
  257.  
  258.     SetRect(&tmprect, 0, 0, dtoolw, dtoolh);
  259.     OffsetRect(&tmprect, (tool / (numtooltypes/2)) * dtoolw, (tool % (numtooltypes/2)) * dtoolh);
  260.     EraseRect(&tmprect);
  261.     /* Confine the image to a square subrect on the left side of the window. */
  262.     imagerect = tmprect;
  263.     imagerect.right = imagerect.left + dtoolh;
  264.     imbuf[0] = '\0';
  265.     switch (tool) {
  266.         case notool:
  267.             toolname = "Normal";
  268.             break;
  269.         case terraintool:
  270.             toolname = t_type_name(curttype);
  271.             InsetRect(&imagerect, (dtoolh - hws[4]) / 2, (dtoolh - hhs[4]) / 2);
  272.             /* Only do bg terrain type if painting cell terrain. */
  273.             if (t_is_cell(curttype)) {
  274.                 auxtoolname = t_type_name(curbgttype);
  275.                 /* bg type is always cell subtype. */
  276.                 OffsetRect(&imagerect, 3, 3);
  277.                 draw_terrain_sample(designwin, imagerect, curbgttype);
  278.                 OffsetRect(&imagerect, -6, -6);
  279.             }
  280.             draw_terrain_sample(designwin, imagerect, curttype);
  281.             break;
  282.         case unittool:
  283.             toolname = u_type_name(curutype);
  284.             InsetRect(&imagerect, (dtoolh - 32) / 2, (dtoolh - 32) / 2);
  285.              draw_unit_image(designwin, imagerect.left, imagerect.top, 32, 32,
  286.                              curutype, cursidenumber, 0);
  287.             /* Gray out the unit if not allowed for the current side. */
  288.             paintable = type_allowed_on_side(curutype, side_n(cursidenumber));
  289.             break;
  290.         case peopletool:
  291.             toolname = shortest_side_title(side_n(cursidenumber), spbuf);
  292.             InsetRect(&imagerect, (dtoolh - 16) / 2, (dtoolh - 16) / 2);
  293.             draw_side_emblem(designwin, imagerect.left, imagerect.top, 16, 16,
  294.                              cursidenumber, shadow_emblem);
  295.             break;
  296.         case featuretool:
  297.             if (enabledtooltype[featuretool]) {
  298.                 if (curfeature == NULL) {
  299.                     curfeature = find_feature(curfid);
  300.                 }
  301.                 if (curfeature != NULL) {
  302.                     toolname = curfeature->name;
  303.                     auxtoolname = curfeature->typename;
  304.                 }
  305.             } else {
  306.                 toolname = "Feature";
  307.                 enabled = FALSE;
  308.             }
  309.             break;
  310.         case brushsizetool:
  311.             OffsetRect(&imagerect, dtoolh/2 - curbrushradius, dtoolh/2 - curbrushradius);
  312.             imagerect.right = imagerect.left + curbrushradius + 1;
  313.             imagerect.bottom = imagerect.top + curbrushradius + 1;
  314.             FillOval(&imagerect, QDPat(black));
  315.             if (curbrushradius > 0) {
  316.                 sprintf(imbuf, "%d", curbrushradius);
  317.             }
  318.             toolname = "Brush";
  319.             break;
  320.         case materialtool:
  321.             if (enabledtooltype[materialtool]) {
  322.                 toolname = m_type_name(curmtype);
  323.                 sprintf(imbuf, "%d", curmamount);
  324.             } else {
  325.                 toolname = "Material";
  326.                 enabled = FALSE;
  327.             }
  328.             break;
  329.         case elevationtool:
  330.             if (enabledtooltype[elevationtool]) {
  331.                 sprintf(spbuf, "Elev %d", curelevation);
  332.                 toolname = spbuf;
  333.             } else {
  334.                 toolname = "Elevation";
  335.                 enabled = FALSE;
  336.             }
  337.             break;
  338.         case temperaturetool:
  339.             if (enabledtooltype[temperaturetool]) {
  340.                 sprintf(spbuf, "Temp %d°", curtemperature);
  341.                 toolname = spbuf;
  342.             } else {
  343.                 toolname = "Temperature";
  344.                 enabled = FALSE;
  345.             }
  346.             break;
  347.         case cloudstool:
  348.             if (enabledtooltype[cloudstool]) {
  349.                 /* Black is not ideal here... */
  350.                 FillRect(&imagerect, QDPat(black));
  351.                 if (curcloudtype > 0) {
  352.                     InsetRect(&imagerect, (dtoolh - hws[4]) / 2, (dtoolh - hhs[4]) / 2);
  353.                     draw_clouds(imagerect.left, imagerect.top, 4, curcloudtype);
  354.                     sprintf(spbuf, "Cloudy (%d)", curcloudtype);
  355.                     toolname = spbuf;
  356.                 } else {
  357.                     toolname = "Clear";
  358.                 }
  359.             } else {
  360.                 toolname = "Clouds";
  361.                 enabled = FALSE;
  362.             }
  363.             break;
  364.         case windstool:
  365.             if (enabledtooltype[windstool]) {
  366.                 InsetRect(&imagerect, (dtoolh - hws[4]) / 2, (dtoolh - hhs[4]) / 2);
  367.                 draw_winds(imagerect.left, imagerect.top, 4, make_raw_wind(curwinddir, curwindforce));
  368.                 if (curwindforce > 0) {
  369.                     sprintf(spbuf, "Winds %s, %d", dirnames[curwinddir], curwindforce);
  370.                     toolname = spbuf;
  371.                 } else {
  372.                     toolname = "Calm";
  373.                 }
  374.             } else {
  375.                 toolname = "Winds";
  376.                 enabled = FALSE;
  377.             }
  378.             break;
  379.         case viewtool:
  380.             if (enabledtooltype[viewtool]) {
  381.                 toolname = "View";
  382.             } else {
  383.                 toolname = "View";
  384.                 enabled = FALSE;
  385.             }
  386.             break;
  387.         default:
  388.             /* ??? */
  389.             break;
  390.     }
  391.     TextSize(12);
  392.     /* Draw a (short) text string in the image area. */
  393.     if (strlen(imbuf) > 0) {
  394.         /* (should center) */
  395.         MoveTo(tmprect.left + (dtoolh - StringWidth(tmpstr)) / 2, tmprect.bottom - 5);
  396.         DrawText(imbuf, 0, strlen(imbuf));
  397.     }
  398.     if (toolname != NULL) {
  399.         MoveTo(tmprect.left + dtoolh, tmprect.top + (auxtoolname != NULL ? dtoolh / 4 + 4
  400.                                                            : dtoolh / 2 + 5));
  401.         if (tool == featuretool)
  402.           Move(- dtoolh, 0);
  403.         DrawText(toolname, 0, strlen(toolname));
  404.     }
  405.     if (auxtoolname != NULL) {
  406.         MoveTo(tmprect.left + dtoolh, tmprect.top + (dtoolh * 3) / 4);
  407.         if (tool == featuretool)
  408.           Move(- dtoolh, 0);
  409.         DrawText(auxtoolname, 0, strlen(auxtoolname));
  410.     }
  411.     if (!paintable) {
  412.         gray_out_rect(&tmprect);
  413.     }
  414.     if (!enabled) {
  415.         gray_out_rect(&tmprect);
  416.     }
  417.     /* Draw gray dividing lines. */
  418.     PenPat(QDPat(gray));
  419.     MoveTo(tmprect.right - 1, tmprect.top);  Line(0, dtoolh);
  420.     MoveTo(tmprect.left, tmprect.bottom - 1);  Line(dtoolw, 0);
  421.     PenNormal();
  422.     /* Highlight the currently selected tool with a heavy outline rect. */
  423.     if (tool == tooltype) {
  424.         tmprect.bottom -= 1;  tmprect.right -= 1;
  425.         InvertRect(&tmprect);
  426.         InsetRect(&tmprect, 3, 3);
  427.         InvertRect(&tmprect);
  428.         if (!enabledtooltype[tool]) {
  429.             InsetRect(&tmprect, -3, -3);
  430.             gray_out_rect(&tmprect);
  431.         }
  432.     }
  433. }
  434.  
  435. /* Respond to a mouse down in the designer's window. */
  436.  
  437. /* This macro implements cycling of a variable through a set of consecutive
  438.    values, with direction controlled by the shift key.  If the limit is 0,
  439.    then the cycling part is not done. */
  440.  
  441. #define OPTION_CYCLE(var, lo, hi, n, mods)  \
  442.   if ((hi) - (lo) > 0) {  \
  443.     (var) = (((var) + ((mods) & shiftKey ? -(n) : (n)) - (lo) + ((hi) - (lo))) % ((hi) - (lo))) + (lo);  \
  444.   } else {  \
  445.     (var) = ((var) + ((mods) & shiftKey ? -(n) : (n)));  \
  446.   }
  447.  
  448. void
  449. do_mouse_down_design(Point mouse, int mods)
  450. {
  451.     int oldtool, poppedtool, newutype, newbgttype, toolchoice;
  452.     Feature *feature;
  453.     Rect tmprect;
  454.     ControlHandle control;
  455.     long choice;
  456.     extern int nextfid;
  457.  
  458.     tmprect.left = 0;  tmprect.right = dtoolw;
  459.     oldtool = poppedtool = tooltype;
  460.     toolchoice = (mouse.v / dtoolh) + (mouse.h > dtoolw ? (numtooltypes / 2) : 0);
  461.     FindControl(mouse, designwin, &control);
  462.     if (control == ttypepopup) {
  463.         TrackControl(control, mouse, (void *) -1);
  464.         choice = LoWord(GetCtlValue(control));
  465.         if (choice > 0)
  466.           curttype = choice - 1;
  467.         poppedtool = terraintool;
  468.     } else if (control == utypepopup) {
  469.         mark_allowed_unit_types();
  470.         TrackControl(control, mouse, (void *) -1);
  471.         choice = LoWord(GetCtlValue(control));
  472.         if (choice > 0)
  473.           curutype = choice - 1;
  474.         poppedtool = unittool;
  475.     } else if (control == sidepopup) {
  476.         mark_allowed_sides();
  477.         TrackControl(control, mouse, (void *) -1);
  478.         choice = LoWord(GetCtlValue(control));
  479.         if (choice > 0) {
  480.             cursidenumber = choice;
  481.             if (cursidenumber > numsides)
  482.               cursidenumber = 0;
  483.         }
  484.         poppedtool = peopletool;
  485.     } else if (control == mtypepopup) {
  486.         TrackControl(control, mouse, (void *) -1);
  487.         choice = LoWord(GetCtlValue(control));
  488.         if (choice > 0) curmtype = choice - 1;
  489.         poppedtool = materialtool;
  490.     } else if (control == featurepopup) {
  491.         TrackControl(control, mouse, (void *) -1);
  492.         choice = LoWord(GetCtlValue(control));
  493.         if (choice > 0) {
  494.             curfid = choice - 1; /* not reliable */
  495.             curfeature = find_feature(curfid);
  496.         }
  497.         poppedtool = featuretool;
  498.     } else if (control == feature_add_button) {
  499.         sprintf(spbuf, "%d", nextfid);
  500.         feature = create_feature("feature", copy_string(spbuf));
  501.         if (feature != NULL) {
  502.             curfeature = feature;
  503.             curfid = feature->id;
  504.             feature_rename_dialog(feature);
  505.             update_feature_menu(feature);
  506.         }
  507.         poppedtool = featuretool;
  508.     } else if (control == feature_remove_button) {
  509.         destroy_feature(curfeature);
  510.         curfeature = NULL;
  511.         curfid = 0;
  512.         build_feature_menu();
  513.     } else if (control == feature_edit_button) {
  514.         feature_rename_dialog(curfeature);
  515.         poppedtool = featuretool;
  516.     } else if (enabledtooltype[toolchoice]) {
  517.         /* Any other click selects the tool. */
  518.         if (toolchoice != brushsizetool) tooltype = toolchoice;
  519.         /* Now handle any shortcuts. */
  520.         switch (toolchoice) {
  521.             case notool:
  522.                 break;
  523.             case terraintool:
  524.                 if (mods & optionKey) {
  525.                     /* Option-click and Option-Shift-click cycle through all
  526.                        the "foreground" terrain types. */
  527.                     OPTION_CYCLE(curttype, 0, numttypes, 1, mods);
  528.                 } else if ((mods & cmdKey) && t_is_cell(curttype)) {
  529.                     /* Cmd-click and Cmd-Shift-click cycle through all
  530.                        the "background" terrain types. */
  531.                     newbgttype = curbgttype;
  532.                     do {
  533.                         OPTION_CYCLE(newbgttype, 0, numttypes, 1, mods);
  534.                         if (newbgttype == curbgttype)
  535.                           break;
  536.                     } while (!t_is_cell(newbgttype));
  537.                     curbgttype = newbgttype;
  538.                 }
  539.                 break;
  540.             case unittool:
  541.                 if (mods & optionKey) {
  542.                     /* Option-click and Option-Shift-click cycle through all
  543.                        the types allowed for the current side. */
  544.                     newutype = curutype;
  545.                     do {
  546.                         OPTION_CYCLE(newutype, 0, numutypes, 1, mods);
  547.                         if (newutype == curutype) break;
  548.                     } while (!type_allowed_on_side(newutype, side_n(cursidenumber)));
  549.                     curutype = newutype;
  550.                 }
  551.                 break;
  552.             case peopletool:
  553.                 if (mods & optionKey) {
  554.                     /* Option-click and Option-Shift-click cycle around all the sides. */
  555.                     OPTION_CYCLE(cursidenumber, 0, numsides + 1, 1, mods);
  556.                 }
  557.                 break;
  558.             case featuretool:
  559.                 if (mods & optionKey && nextfid > 1) {
  560.                     /* Option-click and Option-Shift-click cycle around the features. */
  561.                     OPTION_CYCLE(curfid, 0, nextfid, 1, mods);
  562.                     curfeature = find_feature(curfid);
  563.                 }
  564.                 break;
  565.             case brushsizetool:
  566.                 if (mods & optionKey) {
  567.                     /* Option-click and Option-Shift-click cycle through brush sizes. */
  568.                     OPTION_CYCLE(curbrushradius, 0, 100, 1, mods);
  569.                 }
  570.                 break;
  571.             case materialtool:
  572.                 if (mods & optionKey) {
  573.                     /* Option-click and Option-Shift-click cycle around amounts. */
  574.                     OPTION_CYCLE(curmamount, 0, 10000, 1, mods);
  575.                 } else if (mods & cmdKey) {
  576.                     /* Command-click and Command-Shift-click adjust by 10. */
  577.                     OPTION_CYCLE(curmamount, 0, 10000, 10, mods);
  578.                 }
  579.                 break;
  580.             case elevationtool:
  581.                 if (mods & optionKey) {
  582.                     /* Option-click and Option-Shift-click adjust the elevation. */
  583.                     OPTION_CYCLE(curelevation, minelev, maxelev + 1, 1, mods);
  584.                 } else if (mods & cmdKey) {
  585.                     /* Command-click and Command-Shift-click adjust by 10. */
  586.                     OPTION_CYCLE(curelevation, minelev, maxelev + 1, 10, mods);
  587.                 }
  588.                 break;
  589.             case temperaturetool:
  590.                 if (mods & optionKey) {
  591.                     /* Option-click and Option-Shift-click adjust the temp. */
  592.                     OPTION_CYCLE(curtemperature, mintemp, maxtemp + 1, 1, mods);
  593.                 } else if (mods & cmdKey) {
  594.                     /* Command-click and Command-Shift-click adjust by 10. */
  595.                     OPTION_CYCLE(curtemperature, mintemp, maxtemp + 1, 10, mods);
  596.                 }
  597.                 break;
  598.             case cloudstool:
  599.                 if (mods & optionKey) {
  600.                     /* Option-click and Option-Shift-click adjust the cloud type. */
  601.                     OPTION_CYCLE(curcloudtype, 0, 4, 1, mods);
  602.                 }
  603.                 break;
  604.             case windstool:
  605.                 if (mods & optionKey) {
  606.                     /* Option-click and Option-Shift-click adjust the wind force. */
  607.                     OPTION_CYCLE(curwindforce, minwindforce, maxwindforce, 1, mods);
  608.                 } else if (mods & cmdKey) {
  609.                     /* Cmd-click and Cmd-Shift-click adjust the direction. */
  610.                     OPTION_CYCLE(curwinddir, 0, NUMDIRS, 1, mods);
  611.                 }
  612.                 break;
  613.             case viewtool:
  614.                 /* Nothing to do? */
  615.                 break;
  616.             default:
  617.                 break;
  618.         }
  619.     }
  620.     /* Draw the old and new tools. */
  621.     if (oldtool != tooltype) {
  622.         draw_design_window_tool(oldtool);
  623.     }
  624.     if (poppedtool != tooltype) {
  625.         draw_design_window_tool(poppedtool);
  626.     }
  627.     draw_design_window_tool(tooltype);
  628.     if (toolchoice != tooltype)
  629.       draw_design_window_tool(toolchoice);
  630.     /* As a special case, redraw the unit tool if the side tool was touched. */
  631.     if (tooltype == peopletool || poppedtool == peopletool) {
  632.         draw_design_window_tool(unittool);
  633.     }
  634.     /* (should only draw controls in relevant tools) */
  635.     DrawControls(designwin);
  636. }
  637.  
  638. void
  639. mark_allowed_unit_types()
  640. {
  641.     Side *side = side_n(cursidenumber);
  642.     int u;
  643.  
  644.     for_all_unit_types(u) {
  645.         EnableItem(utypemenu, u + 1);
  646.         SetItemMark(utypemenu, u + 1,
  647.                     (type_allowed_on_side(u, side) ? diamondMark : noMark));
  648.     }
  649. }
  650.  
  651. void
  652. mark_allowed_sides()
  653. {
  654.     Side *side;
  655.  
  656.     for_all_sides(side) {
  657.         EnableItem(sidemenu, side_number(side));
  658.         SetItemMark(sidemenu, side_number(side),
  659.                     (type_allowed_on_side(curutype, side) ? diamondMark : noMark));
  660.     }
  661.     EnableItem(sidemenu, numsides + 1);
  662.     SetItemMark(sidemenu, numsides + 1,
  663.                 (type_allowed_on_side(curutype, NULL) ? diamondMark : noMark));
  664. }
  665.  
  666. void
  667. feature_rename_dialog(Feature *feature)
  668. {
  669.     short done = FALSE, ditem;
  670.     char *newtypename, *newname;
  671.     Str255 tmpstr;
  672.     DialogPtr win;
  673.     short itemtype;  Handle itemhandle;  Rect itemrect;
  674.  
  675.     if (feature == NULL) return;
  676.     win = GetNewDialog(dFeatureRename, NULL, (DialogPtr) -1L);
  677.     /* Seed the text items with the original names. */
  678.     newtypename = feature->typename;
  679.     if (newtypename == NULL)
  680.       newtypename = "";
  681.     GetDItem(win, diFeatureRenameType, &itemtype, &itemhandle, &itemrect);
  682.     c2p(newtypename, tmpstr);
  683.     SetIText(itemhandle, tmpstr);
  684.     newname = feature->name;
  685.     if (newname == NULL)
  686.       newname = "";
  687.     GetDItem(win, diFeatureRenameName, &itemtype, &itemhandle, &itemrect);
  688.     c2p(newname, tmpstr);
  689.     SetIText(itemhandle, tmpstr);
  690.     ShowWindow(win);
  691.     while (!done) {
  692.         /* Deactivate the front window. */
  693.         activate_window(FrontWindow(), FALSE);
  694.         SetCursor(&QD(arrow));
  695.         ModalDialog(NULL, &ditem);
  696.         switch (ditem) {
  697.             case diRenameOK:
  698.                 GetDItem(win, diFeatureRenameType, &itemtype, &itemhandle, &itemrect);
  699.                 set_feature_type_name(feature, get_string_from_item(itemhandle));
  700.                 GetDItem(win, diFeatureRenameName, &itemtype, &itemhandle, &itemrect);
  701.                 set_feature_name(feature, get_string_from_item(itemhandle));
  702.                 /* Fall into next case. */
  703.             case diRenameCancel:
  704.                 done = TRUE;
  705.                 break;
  706.         }
  707.     }
  708.     DisposDialog(win);
  709. }
  710.  
  711. /* Handling of mousedowns in the map when designing. */
  712.  
  713. void
  714. apply_designer_tool(Map *map, int h, int v, int mods)
  715. {
  716.     int x, y, dir;
  717.     int oldt, oldpeop, oldfid, oldtview, olduview;
  718.     Unit *unit;
  719.  
  720.     m_nearest_boundary(map, h, v, &x, &y, &dir);
  721.     switch (tooltype) {
  722.         case terraintool:
  723.             /* Dispatch on terrain subtype. */
  724.             switch (t_subtype(curttype)) {
  725.                 case cellsubtype:
  726.                     /* Choose to paint fg or bg type, depending on what's already
  727.                        there. */
  728.                     oldt = terrain_at(x, y);
  729.                     painttype = (curttype == oldt ? curbgttype : curttype);
  730.                     paint_cell(dside, x, y, curbrushradius, painttype);
  731.                     paint_on_drag(map, h, v, mods);
  732.                     break;
  733.                 case bordersubtype:
  734.                     /* Toggle border on first mouse down. */
  735.                     paint_border(dside, x, y, dir, curttype, -1);
  736.                     /* Dragging then adds or removes, depending on toggle's result. */
  737.                     border_on_drag(map, h, v, mods, border_at(x, y, dir, curttype));
  738.                     break;
  739.                 case connectionsubtype:
  740.                     /* Toggle connection on first mouse down. */
  741.                     paint_connection(dside, x, y, dir, curttype, -1);
  742.                     /* Dragging then adds or removes, depending on toggle's result. */
  743.                     connect_on_drag(map, h, v, mods, connection_at(x, y, dir, curttype));
  744.                     break;
  745.                 case coatingsubtype:
  746.                     paint_coating(dside, x, y, curbrushradius, curttype, curdepth);
  747.                     paint_on_drag(map, h, v, mods);
  748.                     break;
  749.                 default:
  750.                     terrain_subtype_warning("apply tool", curttype);
  751.                     break;
  752.             }
  753.             return;
  754.         case unittool:
  755.             /* A last check, should never(?) fail. */
  756.             if (!type_allowed_on_side(curutype, side_n(cursidenumber))) {
  757.                 beep();
  758.                 return;
  759.             }
  760.             unit = designer_create_unit(dside, curutype, cursidenumber, x, y);
  761.             if (unit != NULL) {
  762.                 /* Make the new unit automatically be the current selection. */
  763.                 unselect_all(map);
  764.                 select_unit_on_map(map, unit);
  765.                 draw_selections_at(map, unit->x, unit->y);
  766.             } else {
  767.                 /* Beep if the creation failed for some reason. */
  768.                 beep();
  769.             }
  770.             /* No use for drag painting here, unlike most other tools. */
  771.             break;
  772.         case peopletool:
  773.             /* Paint people or clear, inverting from what is already here. */
  774.             oldpeop = people_side_at(x, y);
  775.             paintpeop = (cursidenumber == oldpeop ? NOBODY : cursidenumber);
  776.             paint_people(dside, x, y, curbrushradius, paintpeop);
  777.             paint_on_drag(map, h, v, mods);
  778.             break;
  779.         case featuretool:
  780.             oldfid = raw_feature_at(x, y);
  781.             paintfid = (curfid == oldfid ? 0 : curfid);
  782.             paint_feature(dside, x, y, curbrushradius, paintfid);
  783.             paint_on_drag(map, h, v, mods);
  784.             break;
  785.         case materialtool:
  786.             paint_material(dside, x, y, curbrushradius, curmtype, curmamount);
  787.             paint_on_drag(map, h, v, mods);
  788.             break;
  789.         case elevationtool:
  790.             paint_elevation(dside, x, y, curbrushradius, curelevation);
  791.             paint_on_drag(map, h, v, mods);
  792.             break;
  793.         case temperaturetool:
  794.             paint_temperature(dside, x, y, curbrushradius, curtemperature);
  795.             paint_on_drag(map, h, v, mods);
  796.             break;
  797.         case cloudstool:
  798.             paint_clouds(dside, x, y, curbrushradius, curcloudtype, curcloudbottom, curcloudheight);
  799.             paint_on_drag(map, h, v, mods);
  800.             break;
  801.         case windstool:
  802.             paint_winds(dside, x, y, curbrushradius, curwinddir, curwindforce);
  803.             paint_on_drag(map, h, v, mods);
  804.             break;
  805.         case viewtool:
  806.             if (dside->terrview == NULL || dside->unitview == NULL)
  807.               break;
  808.             oldtview = terrain_view(dside, x, y);
  809.             painttview = (curtview == oldtview ? UNSEEN : curtview);
  810.             olduview = unit_view(dside, x, y);
  811.             paintuview = (curuview == olduview ? EMPTY : curuview);
  812.             paint_view(dside, x, y, curbrushradius, painttview, paintuview);
  813.             paint_on_drag(map, h, v, mods);
  814.             break;
  815.         default:
  816.             beep();
  817.     }
  818. }
  819.  
  820. void
  821. paint_on_drag(Map *map, int h0, int v0, int mods)
  822. {
  823.     Point pt0, pt1, newmouse;
  824.     int drawn = FALSE, x, y;
  825.     Rect tmprect;
  826.  
  827.     SetPt(&pt0, h0, v0);
  828.     SetPt(&pt1, h0, v0);
  829.     SetRect(&tmprect, h0, v0, h0, v0);
  830.     while (WaitMouseUp()) {
  831.         GetMouse(&newmouse);
  832.         if (!EqualPt(pt1, newmouse) /* && PtInRect(newmouse, &(map->window->portRect)) */) {
  833.             pt1 = newmouse;
  834.             if (m_nearest_cell(map, pt1.h, pt1.v, &x, &y)) {
  835.                 switch (tooltype) {
  836.                     case terraintool:
  837.                         /* Dispatch on terrain subtype. */
  838.                         switch (t_subtype(curttype)) {
  839.                             /* This sort of drag-paint only works for area fillers,
  840.                                bords/conns use different algorithm. */
  841.                             case cellsubtype:
  842.                                 paint_cell(dside, x, y, curbrushradius, painttype);
  843.                                 break;
  844.                             case coatingsubtype:
  845.                                 paint_coating(dside, x, y, curbrushradius, curttype, curdepth);
  846.                                 break;
  847.                         }
  848.                         break;
  849.                     case peopletool:
  850.                         paint_people(dside, x, y, curbrushradius, paintpeop);
  851.                         break;
  852.                     case materialtool:
  853.                         paint_material(dside, x, y, curbrushradius, curmtype, curmamount);
  854.                         break;
  855.                     case featuretool:
  856.                         paint_feature(dside, x, y, curbrushradius, paintfid);
  857.                         break;
  858.                     case elevationtool:
  859.                         paint_elevation(dside, x, y, curbrushradius, curelevation);
  860.                         break;
  861.                     case temperaturetool:
  862.                         paint_temperature(dside, x, y, curbrushradius, curtemperature);
  863.                         break;
  864.                     case cloudstool:
  865.                         paint_clouds(dside, x, y, curbrushradius, curcloudtype, curcloudbottom, curcloudheight);
  866.                         break;
  867.                     case windstool:
  868.                         paint_winds(dside, x, y, curbrushradius, curwinddir, curwindforce);
  869.                         break;
  870.                     case viewtool:
  871.                         paint_view(dside, x, y, curbrushradius, curtview, curuview);
  872.                         break;
  873.                     default:
  874.                         break;
  875.                 }
  876.             }
  877.         }
  878.     }
  879. }
  880.  
  881. void
  882. border_on_drag(Map *map, int h0, int v0, int mods, int paintmode)
  883. {
  884.     Point pt0, pt1, newmouse;
  885.     int drawn = FALSE, x, y, dir;
  886.     Rect tmprect;
  887.  
  888.     SetPt(&pt0, h0, v0);
  889.     SetPt(&pt1, h0, v0);
  890.     SetRect(&tmprect, h0, v0, h0, v0);
  891.     while (WaitMouseUp()) {
  892.         GetMouse(&newmouse);
  893.         if (!EqualPt(pt1, newmouse) /* && PtInRect(newmouse, &(map->window->portRect)) */) {
  894.             pt1 = newmouse;
  895.             m_nearest_boundary(map, pt1.h, pt1.v, &x, &y, &dir);
  896.             if (inside_area(x, y)) {
  897.                 paint_border(dside, x, y, dir, curttype, paintmode);
  898.             }
  899.         }
  900.     }
  901. }
  902.  
  903. void
  904. connect_on_drag(Map *map, int h0, int v0, int mods, int paintmode)
  905. {
  906.     Point pt0, pt1, newmouse;
  907.     int drawn = FALSE, x, y, dir;
  908.     Rect tmprect;
  909.  
  910.     SetPt(&pt0, h0, v0);
  911.     SetPt(&pt1, h0, v0);
  912.     SetRect(&tmprect, h0, v0, h0, v0);
  913.     while (WaitMouseUp()) {
  914.         GetMouse(&newmouse);
  915.         if (!EqualPt(pt1, newmouse) /* && PtInRect(newmouse, &(map->window->portRect)) */) {
  916.             pt1 = newmouse;
  917.             m_nearest_boundary(map, pt1.h, pt1.v, &x, &y, &dir);
  918.             if (inside_area(x, y)) {
  919.                 paint_connection(dside, x, y, dir, curttype, paintmode);
  920.             }
  921.         }
  922.     }
  923. }
  924.  
  925. /* This allows the designer to choose which parts of a game to write out. */
  926.  
  927. int defunitids; /* should be module slot */
  928.  
  929. void
  930. designer_save_dialog()
  931. {
  932.     int done = FALSE;
  933.     short ditem;
  934.     char namebuf[BUFSIZE];
  935.     Str255 tmpstr;
  936.     Point pnt;
  937.     WindowPtr win;
  938.     Module *module;
  939.     SFReply reply;
  940.     short itemtype;  Handle itemhandle;  Rect itemrect;
  941.     
  942.     win = GetNewDialog(dDesignerSave, NULL, (DialogPtr) -1L);
  943.     module = create_game_module(NULL);
  944.     module->title = "Designer-saved data";
  945.     if (module == NULL) {
  946.         beep();
  947.         return;
  948.     }
  949.     init_module_reshape(module);
  950.     /* Only rarely does the designer not want to compress all the area layers. */
  951.     module->compress_layers = TRUE;
  952.     GetDItem(win, diDesignerSaveCompress, &itemtype, &itemhandle, &itemrect);
  953.     SetCtlValue((ControlHandle) itemhandle, module->compress_layers);
  954.     while (!done) {
  955.         /* Deactivate the front window. */
  956.         activate_window(FrontWindow(), FALSE);
  957.         SetCursor(&QD(arrow));
  958.         ModalDialog(NULL, &ditem);
  959.         switch (ditem) {
  960.             case diDesignerSaveOK:
  961.                 get_string_from_ditem(diDesignerSaveName, namebuf);
  962.                 module->name = copy_string(namebuf);
  963.                 set_flag_from_ditem(diDesignerSaveTypes, module->def_types);
  964.                 set_flag_from_ditem(diDesignerSaveTables, module->def_tables);
  965.                 set_flag_from_ditem(diDesignerSaveGlobals, module->def_globals);
  966.                 set_flag_from_ditem(diDesignerSaveWorld, module->def_world);
  967.                 set_flag_from_ditem(diDesignerSaveAreas, module->def_areas);
  968.                 set_flag_from_ditem(diDesignerSaveAreaTerrain, module->def_area_terrain);
  969.                 set_flag_from_ditem(diDesignerSaveAreaMisc, module->def_area_misc);
  970.                 set_flag_from_ditem(diDesignerSaveAreaWeather, module->def_area_weather);
  971.                 set_flag_from_ditem(diDesignerSaveAreaMaterial, module->def_area_material);
  972.                 set_flag_from_ditem(diDesignerSaveSides, module->def_sides);
  973.                 set_flag_from_ditem(diDesignerSaveSideViews, module->def_side_views);
  974.                 set_flag_from_ditem(diDesignerSavePlayers, module->def_players);
  975.                 set_flag_from_ditem(diDesignerSaveUnits, module->def_units);
  976.                 set_flag_from_ditem(diDesignerSaveUnitIds, defunitids);
  977.                 set_flag_from_ditem(diDesignerSaveUnitProps, module->def_unit_props);
  978.                 set_flag_from_ditem(diDesignerSaveUnitMoves, module->def_unit_acts);
  979.                 set_flag_from_ditem(diDesignerSaveUnitPlans, module->def_unit_plans);
  980.                 set_flag_from_ditem(diDesignerSaveScoring, module->def_scoring);
  981.                 set_flag_from_ditem(diDesignerSaveHistory, module->def_history);
  982.                 set_flag_from_ditem(diDesignerSaveCompress, module->compress_layers);
  983.                 /* Collect the file and path to save to. */
  984.                 SetPt(&pnt, 100, 100);
  985.                 sprintf(spbuf, "%s.g", namebuf);
  986.                 c2p(spbuf, tmpstr);
  987.                 SFPutFile(pnt, "\p", tmpstr, /*(DlgHookProcPtr)*/ nil, &reply);
  988.                 if (reply.good) {
  989.                     /* Make the location of the file be the current volume. */
  990.                     SetVol(reply.fName, reply.vRefNum);
  991.                     p2c(((char *) reply.fName), namebuf);
  992.                     module->filename = copy_string(namebuf);
  993.                     SetCursor(*watchcursor);
  994.                     if (!write_game_module(module)) {
  995.                         run_warning("Couldn't write the module \"%s\"!", module->filename);
  996.                         /* Don't fall through, might be able to fix by changing save options. */
  997.                         break;
  998.                     }
  999.                     /* Mark as an Xconq game. */
  1000.                     set_game_file_type(module->filename);
  1001.                     SetCursor(&QD(arrow));
  1002.                 } else {
  1003.                     break;
  1004.                 }
  1005.                 /* Fall through to next case. */
  1006.             case diDesignerSaveCancel:
  1007.                 done = TRUE;
  1008.                 break;
  1009.             case diDesignerSaveTypes:
  1010.             case diDesignerSaveTables:
  1011.             case diDesignerSaveGlobals:
  1012.             case diDesignerSaveWorld:
  1013.             case diDesignerSaveAreas:
  1014.             case diDesignerSaveAreaTerrain:
  1015.             case diDesignerSaveAreaMisc:
  1016.             case diDesignerSaveAreaWeather:
  1017.             case diDesignerSaveAreaMaterial:
  1018.             case diDesignerSaveSides:
  1019.             case diDesignerSaveSideNames:
  1020.             case diDesignerSaveSideProps:
  1021.             case diDesignerSaveSideViews:
  1022.             case diDesignerSavePlayers:
  1023.             case diDesignerSaveUnits:
  1024.             case diDesignerSaveUnitIds:
  1025.             case diDesignerSaveUnitProps:
  1026.             case diDesignerSaveUnitMoves:
  1027.             case diDesignerSaveUnitPlans:
  1028.             case diDesignerSaveScoring:
  1029.             case diDesignerSaveHistory:
  1030.             case diDesignerSaveCompress:
  1031.                 /* Toggle check boxes. */
  1032.                 GetDItem(win, ditem, &itemtype, &itemhandle, &itemrect);
  1033.                 SetCtlValue((ControlHandle) itemhandle,
  1034.                             !GetCtlValue((ControlHandle) itemhandle));
  1035.                 break;
  1036.             case diDesignerSaveModule:
  1037.                 /* (should bring up a dialog to set module properties) */
  1038.                 break;
  1039.             case diDesignerSaveReshape:
  1040.                 /* Bring up *another* modal dialog. */
  1041.                 designer_reshape_dialog(module);
  1042.                 break;
  1043.         }
  1044.     }
  1045.     DisposDialog(win);
  1046. }
  1047.  
  1048. /* A special dialog that allows for saving a world of different dimensions than is
  1049.    currently being used in the game. */
  1050.  
  1051. void
  1052. designer_reshape_dialog(Module *module)
  1053. {
  1054.     int done = FALSE;
  1055.     short ditem;
  1056.     WindowPtr win;
  1057.     Str255 tmpstr;
  1058.     short itemtype;  Handle itemhandle;  Rect itemrect;
  1059.     
  1060.     win = GetNewDialog(dDesignerReshape, NULL, (DialogPtr) -1L);
  1061.     while (!done) {
  1062.         /* Deactivate the front window. */
  1063.         activate_window(FrontWindow(), FALSE);
  1064.           put_number_into_ditem(diDesignerReshapeOrigWidth, area.width);
  1065.           put_number_into_ditem(diDesignerReshapeOrigHeight, area.height);
  1066.           put_number_into_ditem(diDesignerReshapeOrigWorld, world.circumference);
  1067.           put_number_into_ditem(diDesignerReshapeOrigSubWidth, module->subarea_width);
  1068.           put_number_into_ditem(diDesignerReshapeOrigSubHeight, module->subarea_height);
  1069.           put_number_into_ditem(diDesignerReshapeOrigSubX, module->subarea_x);
  1070.           put_number_into_ditem(diDesignerReshapeOrigSubY, module->subarea_y);
  1071.           put_number_into_ditem(diDesignerReshapeOutputSubWidth, module->final_subarea_width);
  1072.           put_number_into_ditem(diDesignerReshapeOutputSubHeight, module->final_subarea_height);
  1073.           put_number_into_ditem(diDesignerReshapeOutputSubX, module->final_subarea_x);
  1074.           put_number_into_ditem(diDesignerReshapeOutputSubY, module->final_subarea_y);
  1075.           put_number_into_ditem(diDesignerReshapeOutputWidth, module->final_width);
  1076.           put_number_into_ditem(diDesignerReshapeOutputHeight, module->final_height);
  1077.           put_number_into_ditem(diDesignerReshapeOutputWorld, module->final_circumference);
  1078. /*          put_number_into_ditem(diDesignerReshapeFillTerrain, module->fill_terrain); */
  1079.         SetCursor(&QD(arrow));
  1080.         ModalDialog(NULL, &ditem);
  1081.         switch (ditem) {
  1082.             case diDesignerReshapeOK:
  1083.                   get_number_from_ditem(diDesignerReshapeOrigSubWidth, module->subarea_width);
  1084.                   get_number_from_ditem(diDesignerReshapeOrigSubHeight, module->subarea_height);
  1085.                   get_number_from_ditem(diDesignerReshapeOrigSubX, module->subarea_x);
  1086.                   get_number_from_ditem(diDesignerReshapeOrigSubY, module->subarea_y);
  1087.                   get_number_from_ditem(diDesignerReshapeOutputSubWidth, module->final_subarea_width);
  1088.                   get_number_from_ditem(diDesignerReshapeOutputSubHeight, module->final_subarea_height);
  1089.                   get_number_from_ditem(diDesignerReshapeOutputSubX, module->final_subarea_x);
  1090.                   get_number_from_ditem(diDesignerReshapeOutputSubY, module->final_subarea_y);
  1091.                   get_number_from_ditem(diDesignerReshapeOutputWidth, module->final_width);
  1092.                   get_number_from_ditem(diDesignerReshapeOutputHeight, module->final_height);
  1093.                   get_number_from_ditem(diDesignerReshapeOutputWorld, module->final_circumference);
  1094. /*                  get_number_from_ditem(diDesignerReshapeFillTerrain, module->fill_terrain);  */
  1095.                 /* Fall through to next case. */
  1096.             case diDesignerReshapeCancel:
  1097.                 done = TRUE;
  1098.                 break;
  1099.         }
  1100.     }
  1101.     DisposDialog(win);
  1102. }
  1103.  
  1104. #endif /* DESIGNERS */
  1105.